package Demo01;


class Message<T> {
    private T message ;
    public T getMessage() {
        return message;
    }
    public void setMessage(T message) {
        this.message = message;
    }
}

public class Test {
    public static void main(String[] args) {
        Message<String> message = new Message<>() ;
        message.setMessage("张三");
        fun(message);

        Message<Integer> message1 = new Message<>();
        message1.setMessage(1);
        fun(message1);
    }
    public static void fun(Message<?> temp){
        System.out.println(temp.getMessage());
    }
}
